<!--提案申退 -->
<template>
  <div class="base-table-box">
    <div class="table-select-group">
      <div class="left">
        <s-select
          :selectOption="proposal.proposalSessionId"
          v-model="params.strYear"
        />
        <a-tree-select
          style="width: 200px"
          :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
          :tree-data="treeData"
          tree-default-expand-all
          :treeIcon="true"
          :showSearch="true"
          v-model="params.proposalTypeVal"
        >
        </a-tree-select>
        <s-select
          :selectOption="proposal.searchType"
          v-model="params.searchType"
        />
        <a-input
          class="search-input"
          v-model="params.search"
          placeholder="请输入搜索内容"
        />
        <a-button style="margin-left: 16px" type="primary" @click="start"
          >查询</a-button
        >
        <a-button @click="reset" class="btn-reset">重置</a-button>
      </div>
    </div>

    <a-table
      :pagination="pagination"
      :columns="columns"
      :data-source="tableData"
      :loading="loading"
      :scroll="{ y: '100%' }"
    >
    </a-table>
  </div>
</template>
<script>
import paging from 'mixins/paging'
import deleteItem from 'mixins/delete-table-item.js'
import { proposal } from 'assets/js/select-option-list'
const columns = [
  {
    title: '案号',
    dataIndex: 'proposalNumber'
  },
  {
    title: '题目',
    dataIndex: 'title',
    width: '30%'
  },
  {
    title: '提案者',
    dataIndex: 'proposaName'
  },
  {
    title: '办理类型',
    dataIndex: 'handleType'
  },
  {
    title: '应答复时间',
    dataIndex: 'time',
    sorter: (a, b) => a.name.length - b.name.length
  },
  {
    title: '延期时间',
    dataIndex: 'postponeTime',
    sorter: (a, b) => a.name.length - b.name.length
  },
  {
    title: '状态',
    dataIndex: 'state'
  },
  {
    title: '审核结果',
    dataIndex: 'auditResult'
  }
]
export default {
  data() {
    return {
      returnVisible: false, //退回弹框
      columns,
      proposal,
      params: {
        strYear: undefined,
        strPubState: undefined,
        search: undefined,
        searchType: undefined,
        proposalTypeVal: ''
      },
      year: [
        { key: '2021', label: '2021' },
        { key: '2020', label: '2020' }
      ],
      treeData: [
        {
          title: '=提案类型=',
          value: '',
          key: '1'
        },
        {
          title: '文化建设',
          value: '文化建设',
          key: '2',
          children: [
            {
              value: '街道文化建设',
              key: '2-1',
              title: '街道文化建设'
            }
          ]
        },
        {
          title: '经济建设',
          value: '经济建设',
          key: '3'
        },
        {
          title: '政协建设',
          value: '政协建设',
          key: '4'
        }
      ]
    }
  },
  mixins: [paging, deleteItem],
  methods: {
    returnProposal(record) {
      //退回
      this.returnVisible = true
    },
    signFor(record) {
      this.$router.push('/console/unitproposal/handle/signForList/signFor')
    },
    handleMenuClick() {
      //导出
    },
    start() {
      console.log(this.form)
    },
    reset() {
      this.form = {}
    },
    add() {},
    deleteList(ids) {
      this.deleteItemMixins(() => {}, ids)
    },
    getTableData() {
      for (let i = 0; i < this.pagination.pageSize; i++) {
        this.tableData.push({
          proposalNumber: i,
          title: `关于后疫情期建立智慧教育云平台，共享优质教育资源的建议的提案`,
          proposaType: '政治建设',
          proposaName: '李菲菲',
          time: '2021-03-11 16:11',
          state: '待审核',
          handleType: '主办',
          postponeTime: '2021-03-12',
          auditResult: '通过'
        })
      }
      this.pagination.total = 200
    }
  }
}
</script>
<style lang="less" scoped>
.ant-select {
  min-width: 150px;
}
.action {
  span {
    color: #1c8de8;
    margin: 0 0 0 15px;
    cursor: pointer;
    font-size: 16px;
  }
}
/**按钮重置样式 */
.btn-group {
  display: flex;

  /**扩展按钮重置样式 */
  /deep/.dropdown-btn {
    height: 34px;
    border: 1px solid #d9d9d9;
    background-color: #fff;
    &:hover {
      background-color: #fff;
      border-color: #1c8de8;
      color: #1c8de8;
    }
  }
}
</style>
